<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: new_value.php 11 2013-09-21 11:43:11Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 11 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:43:11 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

echo draw_form('values', FILENAME_PRODUCTS_ATTRIBUTES, 'action=add_product_option_values&'.getMenuID('products_attributes').$val_add, 'post', 'enctype="multipart/form-data" id="dialog_form"');

$nid = $db->db_query("SELECT 
							MAX(products_options_values_id)+1 AS next_id 
						FROM 
							".TABLE_PRODUCTS_OPTIONS_VALUES);

echo draw_hidden_field('value_id', (!empty($nid->fields['next_id']) ? $nid->fields['next_id'] : '1'));
?>
	<table width="100%" cellpadding="6">
		<?php for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) { ?>
		<tr>
			<td class="attributs_new" width="15%">
				<strong><?php echo TABLE_HEADING_OPT_NAME; ?>:</strong>
			</td>
			<td class="attributs_new" width="55%" colspan="2">
				<?php
					echo image('../lang/'.$languages[$i]['directory'].'/'.$languages[$i]['image'], $languages[$i]['name']);
				?>
				<select name="option_id">
					<?php $options = $db->db_query("SELECT
														products_options_id,
														products_options_name
													FROM
														".TABLE_PRODUCTS_OPTIONS."
													WHERE
														language_id = '".$languages[$i]['id']."'
													ORDER BY
														products_options_name");
					while (!$options->EOF) {
						echo '<option name="'.$options->fields['products_options_name'].'" value="'.$options->fields['products_options_id'].'">'.$options->fields['products_options_name'].'</option>';
						$options->MoveNext();
					}
					?>
				</select>
			</td>
		</tr>
		<tr>
			<td class="attributs_name" width="20%">
				<strong><?php echo TABLE_HEADING_OPT_VALUE; ?>:</strong>
			</td>
			<td class="attributs_name" colspan="2">
				<?php echo image('../lang/'.$languages[$i]['directory'].'/'.$languages[$i]['image'], $languages[$i]['name']).' <input type="text" name="value_name['.$languages[$i]['id'].']" size="15">'; ?>
			</td>
		</tr>
		<tr>
			<td class="attributs_name" width="20%">
				<strong>Farbfeld:</strong>
			</td>
			<td class="attributs_name" colspan="2">
				<?php 
					echo draw_input_field('hex_image['.$languages[$i]['id'].']', '', 'class="multiple" style="margin-left: 22px;width:60px"');
				?>
			</td>
		</tr>
		<tr>
			<td class="attributs_name" valign="top">
				<strong><?php echo TABLE_HEADING_OPT_IMAGE; ?>:</strong>
			</td>
			<td class="attributs_name" colspan="2">
				<?php echo image('../lang/'.$languages[$i]['directory'].'/'.$languages[$i]['image'], $languages[$i]['name']).' '. draw_file_field('value_image'. $languages[$i]['id']); ?>
			</td>
		</tr>
		<tr>
			<td class="attributs_name" valign="top">
				<strong><?php echo TABLE_HEADING_OPT_DESC; ?>:</strong>
			</td>
			<td class="attributs_name" colspan="2" valign="top">
				<?php echo image('../lang/'.$languages[$i]['directory'].'/'.$languages[$i]['image'], $languages[$i]['name']).' <textarea name="value_desc['.$languages[$i]['id'].']" cols="50" rows="4" style="width:95%"></textarea>'; ?>
			</td>
		</tr>
		<?php } ?>
	</table>
</form>